package nag.arvind.gudiseva.strings;

public class StringReverse {

	public static void main (String args[]) {
		String ipStr = "ARVIND";
		
		String revStr1 = new StringBuilder(ipStr).reverse().toString();
		System.out.println("Input String: " + ipStr + "  Reverse String: " + revStr1);
		
		/*  For versions earlier than JDK 1.5, useUse StringBuffer */ 
		String revStr2 = new StringBuffer(ipStr).reverse().toString();
		System.out.println("Input String: " + ipStr + "  Reverse String: " + revStr2);
		
		String revStr3 = "";
		for(int i = ipStr.length() -1; i>=0; i--){
			revStr3 = revStr3 + ipStr.charAt(i);
        }
		System.out.println("Input String: " + ipStr + "  Reverse String: " + revStr3);
	}

	
}
